import uuid
from django.db import models
# from apps.UserControl.models.user import User


class BaseModel(models.Model):
    id = models.CharField(primary_key=True, max_length=36, default=uuid.uuid4)
    create_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间")
    update_time = models.DateTimeField(auto_now=True, verbose_name="修改时间")
    desc = models.TextField(null=True, blank=True, verbose_name="备注")
    is_delete = models.BooleanField(null=False, blank=False, default=False, verbose_name="软删除")
    creator = models.ForeignKey(to='User', related_name='+', on_delete=models.SET_NULL, null=True, blank=True,
                                verbose_name='创建人')
    modifier = models.ForeignKey(to='User', related_name='+', on_delete=models.SET_NULL, null=True, blank=True,
                                 verbose_name='修改人')

    class Meta:
        abstract = True
